package com.gzhryc.shared_device.oem.code.config.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.annotaion.UniqueKey;
import com.gzhryc.shared_device.oem.code.config.dao.enums.FuncModelEnum;

import java.util.Date;

/**
 * 功能模块
 * @version 2023-02-03
 */
@Table(name="config_func_model")
public class FuncModel {

    @Id
    protected Long id;

    @UniqueKey(name="key_url")
    @Column(notNull = true,defVal = "1",note = "类型")
    protected Integer type;

    @Column(notNull = true,note = "功能模块名")
    protected String name;

    @Column(name="icon_url",notNull = true,length = 255,note = "功能模块图标")
    protected String iconUrl;
    
    @UniqueKey(name="key_url")
    @Column(notNull = true,length = 255,note = "功能模块路径")
    protected String url;

    @Column(length = 255)
    protected String note;

    @Column(notNull = true,defVal = "1",note = "状态")
    protected Integer state;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    private Long agentUseCount;
    private Long levelUseCount;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getTypeName(){
        return FuncModelEnum.Type.note(this.type);
    }

    public String getStateName(){
        return FuncModelEnum.State.note(this.state);
    }

    public Long getAgentUseCount() {
        return agentUseCount;
    }

    public void setAgentUseCount(Long agentUseCount) {
        this.agentUseCount = agentUseCount;
    }

    public Long getLevelUseCount() {
        return levelUseCount;
    }

    public void setLevelUseCount(Long levelUseCount) {
        this.levelUseCount = levelUseCount;
    }
}
